Path: api/v1/jobs/{jobno}/timers
This API is JSON:API compliant.
This endpoint supports the following methods:
GET POST PATCH
This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.
The resource type for this endpoint is JobTimer
The identifier is jobno-refno
Attributes
The JobTimer resource type attributes are as follows:
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| Comment | string | The timer comment. | |
| LabourInit | string | The initials of the staff member the timer is for. Defaults to the current user if not supplied. | |
| LabourType | string | The labour type for the timer. Defaults to the user's labour type if not supplied. | |
| LineNum | integer | ✓ | The line number of the timer on the job. |
| State | string | Must be left out or null when creating a timer. Otherwise may be Paused, Resumed, or Stopped. Note once stopped the timer will cease to exist (it become a simple labour entry on the job). |
Path: api/v1/jobs/10/timers/10-1 Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example GET (Return specific)
{
"data": {
"id": "10-1",
"type": "JobTimer",
"attributes": {
"LabourInit": "SYS",
"Comment": "Onsite diagnostics",
"LabourType": "Admin",
"State": "Resumed",
"LineNum": 2
},
"links": {
"self": "/api/v1/jobs/10/timers/10-1"
}
}
}
Path: api/v1/jobs/10/timers Request: Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example POST
{
"data": {
"type": "JobTimer",
"attributes": {
"LabourInit": "SYS",
"Comment": "Timer started for diagnostics.",
"LabourType": "Admin"
}
}
}
{
"data": {
"id": "10-3",
"type": "JobTimer",
"attributes": {
"LabourInit": "SYS",
"Comment": "Test",
"LabourType": "Admin",
"State": "Resumed",
"LineNum": 3
},
"links": {
"self": "/api/v1/jobs/10/timers/10-3"
}
}
}
Path: api/v1/jobs/10/timers/10-1 Request: Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example PATCH
{
"data": {
"id": "1",
"type": "JobTimer",
"attributes": {
"LabourInit": "SYS",
"Comment": "Timer running for diagnostics.",
"LabourType": "Admin",
"State": "Resumed"
}
}
}
{
"data": {
"id": "10-1",
"type": "JobTimer",
"attributes": {
"LabourInit": "SYS",
"Comment": "Test",
"LabourType": "Admin",
"State": "Resumed",
"LineNum": 1
},
"links": {
"self": "/api/v1/jobs/10/timers/10-1"
}
}
}